<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model app\modules\Admin\models\Detail */

$this->title = $model->detail_id;
$this->params['breadcrumbs'][] = ['label' => sprintf("%s列表",\yii::$app->params['detail_type'][$model->detail_type]), 'url' => ['index','detail_type'=>$model->detail_type]];
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);
?>
<div class="detail-view panel panel-body">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a('更新', ['update', 'id' => $model->detail_id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('删除', ['delete', 'id' => $model->detail_id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => 'Are you sure you want to delete this item?',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'detail_id',
            'detail_type',
            'detai_com:html',
            'detail_time',
            [
                'attribute' => 'detail_top',
                'value' => function($model){
                    $detail_top  = [0=>'正常', 1=>'置顶'];
                    return $detail_top[$model->detail_top]; 
                },
            ],
            'updated_at',
        ],
    ]) ?>

</div>
